<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="tr09" uri="http://www.51i-star.com/mypagetags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>类型列表</title>
<script type="text/javascript" src="js/jquery-3.1.0.min.js"></script>
<style type="text/css">
	body{
		background:#dae4fe;
	}
	.t{
		border-collapse: collapse;
		border: none;
		width: 600px;
		font-size:14px;
	}
	.t td{
		text-align: center;
	}
	.c{
		font-size:14px;
		color:red;
		margin-left:20px;
	}
	tr:hover{
		cursor:pointer;
	}
	h2,table,.pager{
		margin-left:20px;
	}
	.one1{
		font-size:14px;
		font-weight:bold;
		margin:5px;
	}
</style>
<link rel=stylesheet type=text/css href="css/input.css">
<script>
	function resetDelete(ctId){
		$.get("resetdelete", {ctId:ctId},function(){
			alert("商品类型已删除！");
		});
	}
	$(function(){
		$("tr:even").css("background","#ccffcc");
		$("tr:odd").css("background","#ccffff");
		$("table tr").mouseenter(function(){
			$(this).css("background","#CCC");
		}).mouseleave(function(){
			$("tr:even").css("background","#ccffcc");
			$("tr:odd").css("background","#ccffff");
		});
		$("#mohu").focus(function(){
			$(this).val("");
		});
		$("#mohu").blur(function(){
			var val = $(this).val();
			if(val ==""){
				$(this).val("请输入类型名称");
			}
		});
	});
</script>
</head>
<body>
	<div class="one1">
		商品类型管理->商品类型列表
		<hr>
	</div>
	<h2>商品类型信息</h2>
	<div class="c">${erorr}</div>
	<form action="commoditytypeliebiaozhongzhuan?curpage=1&pagesize=10" method="post">
		<input style="display:none" name="curpage" value="1">
		<input style="display:none" name="pagesize" value="10">
		<select name="parentsid">
			<option value="0">按父类型名称</option>
			<c:forEach items="${typelist}" var="com1">
				<c:if test="${parentsid eq com1.ctId}">
					<option selected="selected" value="${com1.ctId}">${com1.ctName}</option>
				</c:if>
				<c:if test="${parentsid ne com1.ctId}">
					<option value="${com1.ctId}">${com1.ctName}</option>
				</c:if>
			</c:forEach>
		</select>
		<input id="mohu" value="${mohu}" name="mohu">
		<input type="submit" value="查   询">
	</form>
	<table border="1" class="t">
		<tr class="border_bottom_empty">
			<th>商品类型名称</th>
			<th>父类商品类型名称</th>
			<th>操作</th>
		</tr>
		<c:forEach items="${list}" var="com">
			<tr>
				<td width="30%">${com.ctName}</td>
				<td width="30%">${com.parentsName}</td>
				<td width="40%">
					<a href="selectcommoditytype"><img title="添加商品类型" src="images/tubiao3/添加 (1).png"></a>
					<a href="updateCommodityType.jsp?ctId=${com.ctId}&ctName=${com.ctName}"><img title="修改商品类型" src="images/tubiao3/修改 (1).png"></a>
					<a href="deleteCommodityType1.jsp?ctId=${com.ctId}&num=1&curpage=${param.curpage}"><img title="删除商品类型" src="images/tubiao3/删除 (1).png"></a>
					<a href="CommodityTypeZhuanyi1.jsp?ctId=${com.ctId}&curpage=${param.curpage}"><img title="转移商品类型" src="images/tubiao4/转移.png"></a>
				</td>
			</tr>
		</c:forEach>
	</table>
	<div class="pager">
		<tr09:pager mohu="${mohu}" url="commoditytypeliebiaozhongzhuan" parentsid="${parentsid}" pagesize="10" total="${total}" curpage="${param.curpage}"/>
	</div>
</body>
</html>